<template>
  <remote-js :src="this.src" @load="this.load"></remote-js>
</template>

<script>
export default {
  components: {
    'remote-js': {
      render (createElement) {
        var self = this
        console.log(this.src)
        return createElement('script', {
          attrs: { type: 'text/javascript', src: this.src },
          on: {
            load: () => {
              self.$emit('load')
            },
            error: (event) => {
              self.$emit('error', event)
            }
          }
        })
      },
      props: {
        src: { type: String, required: true }
      }
    }
  },
  props: {
    src: { type: String, required: true },
    load: Function,
    error: Function
  }
}
</script>
